package com.rxz.controller;

import com.rxz.entity.Result;
import com.rxz.service.impl.ShopServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("shop")
public class ShopController {

    @Autowired
    private ShopServiceImpl shopService;

    @PostMapping("/getOrder")
    public Result getOrderInfo(@RequestParam("id") Integer id,@RequestParam("userId") Integer userId){
        return shopService.isEndTime(id,userId);
    }

    @PostMapping("/isEnd")
    public Result isOrderEnd(@RequestParam("order_id") String orderId){
        return shopService.isOrderTrue(orderId);
    }
}
